# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=libvorbis

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.3.4
pkgrel=1
pkgdesc="Vorbis codec library (mingw-w64)"
arch=('any')
url="http://xiph.org"
license=('custom')
depends=("${MINGW_PACKAGE_PREFIX}-libogg" "${MINGW_PACKAGE_PREFIX}-gcc-libs")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
options=('strip' 'staticlibs')
source=(http://downloads.xiph.org/releases/vorbis/${_realname}-${pkgver}.tar.gz)
md5sums=('8851c593a52d1ef9c526d95174873852')

build() {
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"
  "${srcdir}"/${_realname}-${pkgver}/configure \
    --enable-shared \
    --enable-static \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST}
  make
}

package() {
  cd ${srcdir}/build-${MINGW_CHOST}  
  make DESTDIR="$pkgdir" install
  rm -r ${pkgdir}${MINGW_PREFIX}/share/doc
}
